package cn.ljy.authority.model;

import cn.ljy.common.model.BaseModel;
import cn.ljy.common.model.validate.UpdateWorkValidation;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

//账户信息
@ApiModel(value = "理发师")
@Data
@EqualsAndHashCode(callSuper = false, of = {"id"})
@NoArgsConstructor
public class SysHairdresser extends BaseModel {

    @NotNull(groups = UpdateWorkValidation.class, message = "id不能为空")
    private Long id;

    @NotBlank(message = "用户id不能为空")
    private SysUser user;
    private Long userID;

    @NotBlank(message = "真实姓名不能为空")
    @Length(max = 50, message = "真实姓名长度不能超过 {max} 个字符")
    private String realName;

    @Range(min = 0, max = 100, message = "从业经验必须在 {min} - {max} 年之间")
    private Integer experience;

    @Length(max = 255, message = "专长技能长度不能超过 {max} 个字符")
    private String specialty;

    @NotNull(message = "评分不能为空")
    @DecimalMin(value = "0.00", inclusive = true, message = "评分不能小于 0.00")
    @DecimalMax(value = "5.00", inclusive = true, message = "评分不能大于 5.00")
    private BigDecimal rating;

    @Length(max = 255, message = "资格认证长度不能超过 {max} 个字符")
    private String certification;

    @Length(max = 255, message = "现住地址长度不能超过 {max} 个字符")
    private String currentAddress;

    @Length(max = 255, message = "身份证正面图片URL长度不能超过 {max} 个字符")
    private String idCardFrontUrl;

    @Length(max = 255, message = "身份证反面图片URL长度不能超过 {max} 个字符")
    private String idCardBackUrl;

    @Length(max = 255, message = "工作照片URL长度不能超过 {max} 个字符")
    private String workPhotoUrl;

    private SysUser auditUser;

    @NotNull(message = "审核结果不能为空")
    private Integer auditResult;

    @Length(max = 255, message = "审核长度不能超过 {max} 个字符")
    private String auditNote;

    private Date auditTime;

    public SysHairdresser(Long id) {
        this.id = id;
    }

}